package com.derek.omshopping.ui.mine;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;

import com.derek.omshopping.R;
import com.derek.omshopping.WebLoadActivity;
import com.derek.omshopping.base.BaseFragment;
import com.derek.omshopping.config.UrlConfig;
import com.derek.omshopping.view.CircleImageView;

import butterknife.BindView;
import butterknife.ButterKnife;

import static com.derek.omshopping.R.id.wv;

/**
 * Created by asus on 2016/10/17 09 49.
 * 邮箱:763433963@qq.com
 * 该fragment用于实现我的页面
 */
public class MineFragment extends BaseFragment {


    @BindView(R.id.cust_logo_iv)
    CircleImageView custLogoIv;
    private Context context;
    @BindView(R.id.setting)
    ImageView setting_mine;
    private static final String LOGIN_URL="https:/m.ocj.com.cn/login";
    public MineFragment(Context context) {
        this.context = context;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        setting_mine.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), SettingActivity.class);
                startActivity(intent);

            }
        });
        custLogoIv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getContext(), WebLoadActivity.class);
                intent.putExtra("webLoadUrl",LOGIN_URL);
                getContext().startActivity(intent);
            }
        });
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_mine;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
            savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        return rootView;
    }
}
